import muBan from './myCanvas';
export default (myCanvas, height, weight) => {
  var color = '#FF0000';
  var color_ = '#000000';

  var font = '12px Arial';
  var font2 = '30px Microsoft YaHei';
  var a = [
    '2',
    '3',
    '4',
    '5',
    '6',
    '7',
    '8',
    '9',
    '10',
    '11',
    '12',
    '13',
    '14',
    '15',
    '16',
    '17',
    '18岁',
  ];
  var l = [
    '200',
    '190',
    '180',
    '170',
    '160',
    '150',
    '140',
    '130',
    '120',
    '110',
    '100',
    '90',
    '80',
    '70',
    '30',
    '20',
    '10',
  ];
  var r = [
    '200',
    '190',
    '180',
    '170',
    '160',
    '150',
    '110',
    '100',
    '90',
    '80',
    '70',
    '60',
    '50',
    '40',
    '30',
    '20',
    '10',
  ];
  var t = '身高(cm)';
  var b = '体重(kg)';
  var title = '中国2~18岁女童身高、体重标准差单位曲线图';
  var arr_h_n3 = [
    [2, 77.3],
    [2.5, 81.4],
    [3, 84.7],
    [3.5, 88.4],
    [4, 91.7],
    [4.5, 94.8],
    [5, 97.8],
    [5.5, 100.7],
    [6, 103.2],
    [6.5, 105.5],
    [7, 108],
    [7.5, 110.4],
    [8, 112.7],
    [8.5, 115],
    [9, 117],
    [9.5, 119.1],
    [10, 121.5],
    [10.5, 123.9],
    [11, 126.9],
    [11.5, 129.9],
    [12, 133],
    [12.5, 135.9],
    [13, 138.2],
    [13.5, 140.1],
    [14, 141.5],
    [14.5, 142.6],
    [15, 143.3],
    [15.5, 143.7],
    [16, 143.7],
    [16.5, 143.8],
    [17, 144],
    [18, 144.4],
  ];
  var arr_h_n2 = [
    [2, 80.5],
    [2.5, 84.8],
    [3, 88.2],
    [3.5, 91.9],
    [4, 95.4],
    [4.5, 98.7],
    [5, 101.8],
    [5.5, 104.9],
    [6, 107.6],
    [6.5, 110.1],
    [7, 112.7],
    [7.5, 115.4],
    [8, 117.9],
    [8.5, 120.3],
    [9, 122.6],
    [9.5, 125],
    [10, 127.6],
    [10.5, 130.3],
    [11, 133.4],
    [11.5, 136.5],
    [12, 139.5],
    [12.5, 142.1],
    [13, 144.2],
    [13.5, 146],
    [14, 147.2],
    [14.5, 148.2],
    [15, 148.8],
    [15.5, 149.2],
    [16, 149.2],
    [16.5, 149.3],
    [17, 149.5],
    [18, 149.8],
  ];
  var arr_h_n1 = [
    [2, 83.8],
    [2.5, 88.4],
    [3, 91.8],
    [3.5, 95.6],
    [4, 99.2],
    [4.5, 102.7],
    [5, 106],
    [5.5, 109.2],
    [6, 112],
    [6.5, 114.7],
    [7, 117.6],
    [7.5, 120.4],
    [8, 123.1],
    [8.5, 125.8],
    [9, 128.3],
    [9.5, 131],
    [10, 133.8],
    [10.5, 136.8],
    [11, 140],
    [11.5, 143.1],
    [12, 145.9],
    [12.5, 148.4],
    [13, 150.3],
    [13.5, 151.8],
    [14, 152.9],
    [14.5, 153.8],
    [15, 154.3],
    [15.5, 154.7],
    [16, 154.7],
    [16.5, 154.7],
    [17, 154.9],
    [18, 155.2],
  ];
  var arr_h_0 = [
    [2, 87.2],
    [2.5, 92.1],
    [3, 95.6],
    [3.5, 99.4],
    [4, 103.1],
    [4.5, 106.7],
    [5, 110.2],
    [5.5, 113.5],
    [6, 116.6],
    [6.5, 119.4],
    [7, 122.5],
    [7.5, 125.6],
    [8, 128.5],
    [8.5, 131.3],
    [9, 134.1],
    [9.5, 137],
    [10, 140.1],
    [10.5, 143.3],
    [11, 146.6],
    [11.5, 149.7],
    [12, 152.4],
    [12.5, 154.6],
    [13, 156.3],
    [13.5, 157.6],
    [14, 158.6],
    [14.5, 159.4],
    [15, 159.8],
    [15.5, 160.1],
    [16, 160.1],
    [16.5, 160.2],
    [17, 160.3],
    [18, 160.6],
  ];
  var arr_h_1 = [
    [2, 90.7],
    [2.5, 95.9],
    [3, 99.4],
    [3.5, 103.3],
    [4, 107],
    [4.5, 110.9],
    [5, 114.5],
    [5.5, 118],
    [6, 121.2],
    [6.5, 124.3],
    [7, 127.6],
    [7.5, 130.8],
    [8, 133.9],
    [8.5, 136.9],
    [9, 139.9],
    [9.5, 143.1],
    [10, 146.4],
    [10.5, 149.8],
    [11, 153.3],
    [11.5, 156.3],
    [12, 158.8],
    [12.5, 160.8],
    [13, 162.3],
    [13.5, 163.4],
    [14, 164.3],
    [14.5, 164.9],
    [15, 165.3],
    [15.5, 165.6],
    [16, 165.5],
    [16.5, 165.6],
    [17, 165.7],
    [18, 165.9],
  ];
  var arr_h_2 = [
    [2, 94.3],
    [2.5, 99.8],
    [3, 103.4],
    [3.5, 107.2],
    [4, 111.1],
    [4.5, 115.2],
    [5, 118.9],
    [5.5, 122.6],
    [6, 126],
    [6.5, 129.2],
    [7, 132.7],
    [7.5, 136.1],
    [8, 139.4],
    [8.5, 142.6],
    [9, 145.8],
    [9.5, 149.2],
    [10, 152.8],
    [10.5, 156.3],
    [11, 160],
    [11.5, 162.9],
    [12, 165.3],
    [12.5, 167.1],
    [13, 168.3],
    [13.5, 169.2],
    [14, 169.9],
    [14.5, 170.4],
    [15, 170.8],
    [15.5, 171.1],
    [16, 171],
    [16.5, 171],
    [17, 171],
    [18, 171.3],
  ];
  var arr_h_3 = [
    [2, 98],
    [2.5, 103.8],
    [3, 107.4],
    [3.5, 111.3],
    [4, 115.3],
    [4.5, 119.5],
    [5, 123.4],
    [5.5, 127.2],
    [6, 130.8],
    [6.5, 134.2],
    [7, 137.9],
    [7.5, 141.5],
    [8, 144.9],
    [8.5, 148.4],
    [9, 151.8],
    [9.5, 155.4],
    [10, 159.2],
    [10.5, 163],
    [11, 166.7],
    [11.5, 169.6],
    [12, 171.8],
    [12.5, 173.3],
    [13, 174.3],
    [13.5, 175],
    [14, 175.5],
    [14.5, 175.9],
    [15, 176.2],
    [15.5, 176.4],
    [16, 176.4],
    [16.5, 176.4],
    [17, 176.5],
    [18, 176.6],
  ];

  var arr_w_n3 = [
    [2, 8.7],
    [2.5, 9.48],
    [3, 10.23],
    [3.5, 10.95],
    [4, 11.62],
    [4.5, 12.3],
    [5, 12.93],
    [5.5, 13.54],
    [6, 14.11],
    [6.5, 14.66],
    [7, 15.27],
    [7.5, 15.89],
    [8, 16.51],
    [8.5, 17.14],
    [9, 17.79],
    [9.5, 18.49],
    [10, 19.29],
    [10.5, 20.23],
    [11, 21.46],
    [11.5, 22.89],
    [12, 24.58],
    [12.5, 26.32],
    [13, 28.11],
    [13.5, 29.81],
    [14, 31.38],
    [14.5, 32.73],
    [15, 33.78],
    [15.5, 34.59],
    [16, 35.06],
    [16.5, 35.4],
    [17, 35.57],
    [18, 35.85],
  ];
  var arr_w_n2 = [
    [2, 9.64],
    [2.5, 10.52],
    [3, 11.36],
    [3.5, 12.16],
    [4, 12.93],
    [4.5, 13.71],
    [5, 14.44],
    [5.5, 15.18],
    [6, 15.87],
    [6.5, 16.55],
    [7, 17.31],
    [7.5, 18.1],
    [8, 18.88],
    [8.5, 19.71],
    [9, 20.56],
    [9.5, 21.49],
    [10, 22.54],
    [10.5, 23.74],
    [11, 25.23],
    [11.5, 26.89],
    [12, 28.77],
    [12.5, 30.64],
    [13, 32.5],
    [13.5, 34.23],
    [14, 35.8],
    [14.5, 37.13],
    [15, 38.16],
    [15.5, 38.94],
    [16, 39.39],
    [16.5, 39.72],
    [17, 39.88],
    [18, 40.15],
  ];
  var arr_w_n1 = [
    [2, 10.7],
    [2.5, 11.7],
    [3, 12.65],
    [3.5, 13.55],
    [4, 14.44],
    [4.5, 15.33],
    [5, 16.2],
    [5.5, 17.09],
    [6, 17.94],
    [6.5, 18.78],
    [7, 19.74],
    [7.5, 20.74],
    [8, 21.75],
    [8.5, 22.83],
    [9, 23.96],
    [9.5, 25.21],
    [10, 26.6],
    [10.5, 28.16],
    [11, 29.99],
    [11.5, 31.93],
    [12, 34.04],
    [12.5, 36.04],
    [13, 37.94],
    [13.5, 39.66],
    [14, 41.18],
    [14.5, 42.45],
    [15, 43.42],
    [15.5, 44.15],
    [16, 44.56],
    [16.5, 44.87],
    [17, 45.01],
    [18, 45.26],
  ];
  var arr_w_0 = [
    [2, 11.92],
    [2.5, 13.05],
    [3, 14.13],
    [3.5, 15.16],
    [4, 16.17],
    [4.5, 17.22],
    [5, 18.26],
    [5.5, 19.33],
    [6, 20.37],
    [6.5, 21.44],
    [7, 22.64],
    [7.5, 23.93],
    [8, 25.25],
    [8.5, 26.67],
    [9, 28.19],
    [9.5, 29.87],
    [10, 31.76],
    [10.5, 33.8],
    [11, 36.1],
    [11.5, 38.4],
    [12, 40.77],
    [12.5, 42.89],
    [13, 44.79],
    [13.5, 46.42],
    [14, 47.83],
    [14.5, 48.97],
    [15, 49.82],
    [15.5, 50.45],
    [16, 50.81],
    [16.5, 51.07],
    [17, 51.2],
    [18, 51.41],
  ];
  var arr_w_1 = [
    [2, 13.31],
    [2.5, 14.6],
    [3, 15.83],
    [3.5, 17.01],
    [4, 18.19],
    [4.5, 19.42],
    [5, 20.66],
    [5.5, 21.98],
    [6, 23.27],
    [6.5, 24.61],
    [7, 26.16],
    [7.5, 27.83],
    [8, 29.56],
    [8.5, 31.45],
    [9, 33.51],
    [9.5, 35.82],
    [10, 38.41],
    [10.5, 41.15],
    [11, 44.09],
    [11.5, 46.87],
    [12, 49.54],
    [12.5, 51.75],
    [13, 53.55],
    [13.5, 54.99],
    [14, 56.16],
    [14.5, 57.06],
    [15, 57.72],
    [15.5, 58.19],
    [16, 58.45],
    [16.5, 58.64],
    [17, 58.73],
    [18, 58.88],
  ];
  var arr_w_2 = [
    [2, 14.92],
    [2.5, 16.39],
    [3, 17.81],
    [3.5, 19.17],
    [4, 20.54],
    [4.5, 22],
    [5, 23.5],
    [5.5, 25.12],
    [6, 26.74],
    [6.5, 28.46],
    [7, 30.45],
    [7.5, 32.64],
    [8, 34.94],
    [8.5, 37.49],
    [9, 40.32],
    [9.5, 43.54],
    [10, 47.15],
    [10.5, 50.92],
    [11, 54.78],
    [11.5, 58.21],
    [12, 61.22],
    [12.5, 63.44],
    [13, 64.99],
    [13.5, 66.03],
    [14, 66.77],
    [14.5, 67.28],
    [15, 67.61],
    [15.5, 67.82],
    [16, 67.93],
    [16.5, 68],
    [17, 68.04],
    [18, 68.1],
  ];
  var arr_w_3 = [
    [2, 16.77],
    [2.5, 18.47],
    [3, 20.1],
    [3.5, 21.69],
    [4, 23.3],
    [4.5, 25.04],
    [5, 26.87],
    [5.5, 28.89],
    [6, 30.94],
    [6.5, 33.14],
    [7, 35.75],
    [7.5, 38.65],
    [8, 41.74],
    [8.5, 45.24],
    [9, 49.19],
    [9.5, 53.77],
    [10, 58.92],
    [10.5, 64.24],
    [11, 69.27],
    [11.5, 72.8],
    [12, 75.32],
    [12.5, 77.05],
    [13, 78.17],
    [13.5, 78.87],
    [14, 79.27],
    [14.5, 79.48],
    [15, 79.6],
    [15.5, 79.68],
    [16, 79.77],
    [16.5, 79.86],
    [17, 79.95],
    [18, 79.9],
  ];

  var m = new muBan(35, 60, 100, 100);
  var c = document.getElementById(myCanvas);
  var ctx = c.getContext('2d');

  m.box(ctx, color, 0.75, 0.2, 17, 68, 18, 180); //画格子
  m.txt(ctx, color, font, a, a, l, r, t, b, 17, 18); //写字
  m.title(ctx, color, font2, title, 17);

  //身高
  m.line(ctx, 218, color, 1, arr_h_n3, 12, 80, 10, 2, false, true, '-3');
  m.line(ctx, 218, color, 2, arr_h_n2, 12, 80, 10, 2, false, false, '-2');
  m.line(ctx, 218, color, 1, arr_h_n1, 12, 80, 10, 2, false, false, '-1');
  m.line(ctx, 218, color, 2, arr_h_0, 12, 80, 10, 2, false, false, '-0');
  m.line(ctx, 218, color, 1, arr_h_1, 12, 80, 10, 2, false, false, '+1');
  m.line(ctx, 218, color, 2, arr_h_2, 12, 80, 10, 2, false, false, '+2');
  m.line(ctx, 218, color, 1, arr_h_3, 12, 80, 10, 2, false, true, '+3');

  //体重
  m.line(ctx, 218, color, 1, arr_w_n3, 16, 10, 10, 2, false, true, '-3');
  m.line(ctx, 218, color, 2, arr_w_n2, 16, 10, 10, 2, false, false, '-2');
  m.line(ctx, 218, color, 1, arr_w_n1, 16, 10, 10, 2, false, false, '-1');
  m.line(ctx, 218, color, 2, arr_w_0, 16, 10, 10, 2, false, false, '0');
  m.line(ctx, 218, color, 1, arr_w_1, 16, 10, 10, 2, false, false, '+1');
  m.line(ctx, 218, color, 2, arr_w_2, 16, 10, 10, 2, false, false, '+2');
  m.line(ctx, 218, color, 1, arr_w_3, 16, 10, 10, 2, false, true, '+3');

  height && m.line(ctx, 218, color_, 1, height, 12, 80, 10, 2, true, false, null); //身高
  weight && m.line(ctx, 218, color_, 1, weight, 16, 10, 10, 2, true, false, null); //体重
};
